Crate rusty_jsc

source ·
Expand description

This library provides a Rust API for the JavaScriptCore engine.

Example

The JavaScriptCore engine lets you evaluate JavaScript scripts from your own application. You first need to create a JSContext object and then call its evaluate_script method.

use rusty_jsc::JSContext;

let mut context = JSContext::default();
match context.evaluate_script("'hello, world'", 1) {
    Ok(value) => {
        println!("{}", value.to_string(&context).unwrap());
    }
    Err(e) => {
        println!(
            "Uncaught: {}",
            e.to_string(&context).unwrap()
        )
    }
}

Modules

Macros

Structs

Type Definitions

Attribute Macros